<%
  # initialization code for this partial 
  # user needs to specify :deal, :login_action, :counter(opt) 
%>

<% if session[:user] %>
      <% rate = 'rate'+question.id.to_s; rateplus = rate+'plus'; rateminus = rate+'minus' %>
      <%= link_to_remote(" + ",:update => rateplus,:url => { :action => :rate_ajax, :id => question, :rating=>1}) %>
      <%= '<span id="'+rateplus+'">'+question.rate_plus.to_s%></span> 
      <%= link_to_remote(" - ",:update => rateminus,:url => { :action => :rate_ajax, :id => question, :rating=>-1}) %>
      <%= '<span id="'+rateminus+'">'+question.rate_minus.to_s%></span> 
<% else %>      
      <% rate = 'rate'+question.id.to_s; rateplus = rate+'plus'; rateminus = rate+'minus' %>
      <%= link_to ' + ', :action=>login_action %>
      <%= '<span id="'+rateplus+'">'+question.rate_plus.to_s%></span> 
      <%= link_to ' - ', :action=>login_action %>
      <%= '<span id="'+rateminus+'">'+question.rate_minus.to_s%></span> 
<% end %>      
      